var t = require("../../../@babel/runtime/helpers/typeof"), a = getApp();

Page({
    data: {
        language: "",
        integral: 0,
        transfer_set: 0,
        withdraw_set_title: 0,
        name: "",
        ios_virtual_pay: !1,
        is_transformation: "",
        love_name: "",
        is_transformation_point: !1,
        point_name: ""
    },
    onLoad: function(a) {
        try {
            var e = function() {
                for (var t = wx.getStorageSync("yz_basic_info"), a = t.popularize_page.mini.vue_route, e = 0; e < a.length; e++) if ("Integral_love" == a[e]) return console.log(t.popularize_page.mini.mini_url + "跳转的路径"), 
                wx.showToast({
                    title: "未开启推广权限",
                    duration: 2e3,
                    icon: "none",
                    success: function() {
                        setTimeout(function() {
                            wx.redirectTo({
                                url: t.popularize_page.mini.mini_url
                            });
                        }, 1e3);
                    }
                }), {
                    v: void 0
                };
            }();
            if ("object" === t(e)) return e.v;
        } catch (t) {
            console.log(t);
        }
        this.getName(), this.getData();
        try {
            var n = wx.getStorageSync("ios_virtual_pay");
            n && this.setData({
                ios_virtual_pay: n
            });
        } catch (t) {
            console.log(t);
        }
    },
    onReady: function() {
        var t = wx.getStorageSync("langIndex");
        this.setData({
            language: t.en
        });
    },
    onShow: function() {
        this.getData();
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    getName: function() {
        var t = this, e = a.getNetAddresss("plugin.integral.Frontend.Controllers.page.get-name");
        a._getNetWork({
            url: e,
            success: function(a) {
                var e = a.data;
                1 === e.result ? t.setData({
                    name: e.data
                }) : wx.showToast({
                    title: e.msg,
                    icon: "none",
                    duration: 2e3
                });
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    getData: function() {
        var t = this, e = a.getNetAddresss("plugin.integral.Frontend.Controllers.Page.index");
        a._getNetWork({
            url: e,
            success: function(a) {
                var e = a.data;
                1 === e.result ? (t.setData({
                    integral: e.data.member_integral,
                    transfer_set: e.data.transfer_set,
                    is_transformation: e.data.is_transformation,
                    love_name: e.data.love_name,
                    withdraw_set_title: e.data.withdraw_set_title,
                    manual_withdraw_set_switch: e.data.manual_withdraw_set_switch,
                    is_recharge: e.data.is_recharge.is_recharge
                }), e.data.is_transformation_point && t.setData({
                    point_name: e.data.point_name,
                    is_transformation_point: e.data.is_transformation_point
                })) : wx.showToast({
                    title: e.msg,
                    icon: "none",
                    duration: 2e3
                });
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    gotoPage: function(t) {
        var a = t.target.dataset.url || t.currentTarget.dataset.url;
        if ("Integral_invest" == a && this.data.ios_virtual_pay) return wx.showModal({
            title: "提示",
            content: "十分抱歉，由于相关规定，你暂时无法在这里充值！",
            confirmText: "知道了",
            showCancel: !1,
            success: function(t) {}
        }), !1;
        "Integral_change2" != a ? "overseas_explain" != a ? "handWithdraw" != a ? wx.navigateTo({
            url: "/packageB/member/" + a + "/" + a
        }) : wx.navigateTo({
            url: "/packageB/member/handWithdraw/handWithdraw"
        }) : this.setData({
            show: !0
        }) : wx.navigateTo({
            url: "/packageB/member/Integral_change/Integral_change?type=shift"
        });
    },
    onClickLeft: function() {
        this.setData({
            show: !1
        });
    },
    onClickRight: function() {
        wx.navigateTo({
            url: "/packageB/member/Integral_love_detail/Integral_love_detail"
        });
    }
});